Kameleon-Plus  0.3.2
OpenGGCM.h
Go to the documentation of this file.
1 /*
2  * OpenGGCM.h
3  *
4  * Created on: Jun 2, 2009
5  * Author: David Berrios
6  */
7 
8 #ifndef OPENGGCM_H_
9 #define OPENGGCM_H_
10 #include <string>
11 #include "Cell3D.h"
12 #include "Model.h"
13 #include <vector>
14 #include <boost/unordered_map.hpp>
15 
16 namespace ccmc
17 {
24  class OpenGGCM: public Model
25  {
26 
27  public:
28  OpenGGCM();
29  long open(const std::string& filename);
30 
31  //Cell3D<float, float> getCell(std::string& variable, float c0, float c1, float c2);
33  const std::vector<float>* const getXGrid(const std::string& variable);
34  const std::vector<float>* const getXGrid(long variable);
35  const std::vector<float>* const getYGrid(const std::string& variable);
36  const std::vector<float>* const getYGrid(long variable);
37  const std::vector<float>* const getZGrid(const std::string& variable);
38  const std::vector<float>* const getZGrid(long variable);
39 
40  std::string getXGridName(const std::string& variable);
41  std::string getXGridName(long variable_id);
42  std::string getYGridName(const std::string& variable);
43  std::string getYGridName(long variable_id);
44  std::string getZGridName(const std::string& variable);
45  std::string getZGridName(long variable_id);
46  const std::vector<std::string> getLoadedVariables();
47 
48  //void loadVariable(std::string variable);
49  virtual ~OpenGGCM();
50 
51  protected:
53  void initializeSIUnits();
54 
55  private:
56 // int nx;
57 // int ny;
58 // int nz;
59  std::vector<float> * x_array;
60  std::vector<float> * y_array;
61  std::vector<float> * z_array;
62  std::string previousVariable;
63  long previousVariableID;
64  float previousConversionFactor;
65  float previous_x;
66  float previous_y;
67  float previous_z;
68  int previous_ix;
69  int previous_iy;
70  int previous_iz;
71 
72  void initializeMaps();
73 
74 
75  boost::unordered_map<std::string, std::string> xGrid;
76  boost::unordered_map<long, std::string> xGridByID;
77 
78  boost::unordered_map<std::string, std::string> yGrid;
79  boost::unordered_map<long, std::string> yGridByID;
80 
81  boost::unordered_map<std::string, std::string> zGrid;
82  boost::unordered_map<long, std::string> zGridByID;
83 
84  };
85 
86 }
87 #endif /* OPENGGCM_H_ */